home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows Expert
/
Windows Expert.iso
/
windownt
/
cshx86.zip
/
SAMPLES
/
MYECHO.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-14
|
815b
|
27 lines
/***************************************************************************/
/* */
/* */
/* A variant of echo that prints quotes around each argument. */
/* Copyright (c) 1989-1992 by Hamilton Laboratories. All rights reserved. */
/* */
/* */
/***************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void cdecl main ( int argc, char *argv[] )
{
int i, length = 0;
for (i = 0; i < argc - 1; i++)
{
length += strlen(argv[i]) + 1;
printf ("'%s' ", argv[i]);
}
length += strlen(argv[i]) + 1;
printf("'%s'\n", argv[i]);
printf("arg length = %d characters\n", length);
exit(0);
}